@import "@common/styles/index.scss";
@mixin single-line() {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
@mixin flex() {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.wrapper {
  @include flex();
  flex-direction: column;
  align-items: stretch;
  height: 100vh;
  background: $body-bg-color;
  width: 100%;

  .header {
    @include flex();
    width: 100%;
    padding: $padding-4n $padding-4n $padding-2n;
    background: $white;

    .input-box {
      flex: 1;
      @include flex();
      padding: 0 $padding-2n;
      background: $body-bg-color;
      border-radius: $border-radius-small;

      .icon-box {
        flex: 0 0 32px;
        height: 32px;
        height: 36px;
        display: flex;
      }
      .search-icon {
        margin: auto;
        color: $icon-color-light;
      }
      .delete-icon {
        margin: auto;
        color: $text-color-placeholder !important;
      }
    }

    .btn-cancel {
      flex-basis: 44px;
      font-size: $font-size-primary;
      color: $text-color-secondary;
      text-align: right;
    }
  }

  :global {
    .dzq-input {
      width: 100%;
      background: $body-bg-color;

      .dzq-input__inner {
        height: 36px;
        padding: 0;
        font-size: $font-size-middle;
        color: $text-color-primary;
        background: $body-bg-color;
        border: none;
      }

      .input-placeholder {
        color: $text-color-placeholder;
      }
    }
  }

  .check-box {
    flex: 1;
    overflow: hidden;
    .list {
      height: 100%;
    }
  }

  .at-item {
    background: $white;

    .at-item__inner {
      height: 70px;
      margin: 0 $margin-4n;
      border-top: $border-solid-1;

      :global {
        .dzq-checkbox-wrap.is-checked {
          .dzq-checkbox {
            border: none;
          }
        }
      }
    }
    &:first-child .at-item__inner {
      border-top: none;
    }

    .avatar {
      width: 38px;
      height: 38px;

      :global {
        .dzq-avatar {
          width: 100%;
          height: 100%;
          font-size: 22px;
          color: $white;
          text-align: center;
          line-height: 38px;
          border-radius: $border-radius-circle;

          .dzq-avatar__img {
            width: 100%;
            height: 100%;
            border-radius: $border-radius-circle;
          }
        }
      }
    }

    .info {
      flex: 1;
      @include flex();
      height: 100%;
      padding: 0 $padding-2n;
      .username {
        max-width: 170px;
        @include single-line();
        line-height: $font-line-height-small;
        font-size: $font-size-primary;
        color: $text-color-primary;
        text-align: left;
      }
      .group {
        max-width: 80px;
        @include single-line();
        font-size: $font-size-small;
        color: $text-color-secondary;
        text-align: right;
      }
    }

    :global {
      .dzq-checkbox-wrap {
        @include flex();
        width: 100%;
        margin: 0;
        padding: $padding-4n 0;
        -webkit-tap-highlight-color: transparent;

        .dzq-checkbox {
          order: 2;
          flex: 0 0 20px;
          width: 20px;
          height: 20px;
          border-radius: $border-radius-small;
          background-color: $text-bg-color;
          border: $border-solid-1;
          &::after {
            border: none;
          }
        }
        &.is-checked {
          .dzq-checkbox {
            background-color: $checkbox-checked-bg-color;
          }
          .dzq-icon {
            font-size: $font-size-small !important;
            color: $primary-color;
          }
        }

        .dzq-checkbox__label {
          order: 1;
          flex: 1;
          margin-left: 0;
          @include flex();
        }
      }
    }
  }

  .btn-container {
    flex-basis: 60px;
    padding: $padding-2n $padding-4n;
    padding-bottom: calc(8px + constant(safe-area-inset-bottom));
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    background: $white;
    border-top: $border-solid-1;

    :global {
      .dzq-button {
        width: 100%;
        height: 42px;
        padding: $padding-10 0;
        font-size: $font-size-middle;
        color: $text-color-regular;
        border: none;
        border-radius: $border-radius-small;
        background: $text-bg-color2;
        -webkit-tap-highlight-color: transparent;
      }
    }

    .selected {
      color: $white;
      background-color: $primary-color;
    }
  }
}
